#include <stdio.h>
#include <Windows.h>
#include <time.h>

using namespace std;

int main()
{
	int N = 512;
	int i, j, k; 
	float sum;
	float **A =  new float*[N];
	float **B =  new float*[N];
	float **C =  new float*[N];
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N; ++j){
			A[i] = new float[N];
			B[i] = new float[N];
			C[i] = new float[N];
	    }
	for (int i = 0; i < N; ++i)
		for (int j = 0; j < N; ++j){
			A[i][j] = 0.0f;
			B[i][j] = 1.0f;			
		}
	DWORD dwOldTime = GetTickCount();
	for (i = 0; i < N; ++i) 
		for (j = 0; j < N; ++j) {
			sum = 0; 
			for (k = 0; k < N; ++k)			
				sum += A[i][k] * B[k][j];		
			C[i][j] = sum;
		}
	DWORD finish = GetTickCount();
	DWORD dwTimeElapsed = finish - dwOldTime;
	 
	printf("%u\n", dwTimeElapsed);
	//system("pause");
	return 0;
}

